{include file="public/header" /}
<body>
<div class="x-body">
    <div class="layui-row">
        <div class="container-wrap">
            <div class="box-1">
                <table id="table0" class="layui-table">
                    <thead>
                    <tr>
                        <th>订单编号 测试</th>
                        <th>订单内容</th>
                        <th>交货日期</th>
                        <th>客户简称</th>
                        <th>备料</th>
                        <th>订单报价</th>
                        <th>客户项目号</th>
                        <th>完成</th>
                        <th>发货</th>
                        <th>收款</th>
                        <th>评审</th>
                        <th>建档时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name ="orderInfo" id="info"}
                    <tr>
                        <!--<td><a title="订单明细" href="" style="color: green"  data-id="{$info.order_id}"> {$info.order_id} </a></td>-->
                        <td>  <a title="订单明细" style="color: green" onclick="addOrder(this,'{$info.id}')" href="#"> {$info.order_id} </a></td>
                        <!--<td>  <a title="订单明细" onclick="x_admin_show('<span class=\' layui-bg-blue\'>{$info.order_id}</span> 订单明细','{:url(\'index/Order/orderDetail\',[\'id\'=>$info.id])}')", href="javascript:;"> {$info.order_id} </a></td>-->

                        <td>{$info.order_content}</td>
                        <td>{$info.delivery_time}</td>
                        <td>{$info.client_id|getClientAbbreviation}</td>
                        <td>{$info.prepare}</td>
                        <td>{$info.order_price}</td>
                        <td>
                            {$info.client_prj_id}
                        </td>
                        <td>
                            {if $info.if_complete == 1} 完成 {else/} 未完成 {/if}
                        </td>
                        <td>
                            {if $info.deliver_goods}已发货{else/}未发货{/if}
                        </td>
                        <td>
                            {if $info.receivables == 1} 已收款 {else/} 未收款 {/if}
                        </td>
                        <td></td>
                        <td>{$info.create_time}</td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </div>
        </div>
        <div class="page">
            {$orderInfo|raw}
        </div>
    </div>
</div>
</body>
<script>
        function addOrder(obj,id){
        var url = "/index/Order/orderDetail/actrion/0/id/"+id;

        top.SearchTeacherLayerId = top.layer.open({
            title: "选择产品",
            type: 2,
            shadeClose: true,
            area: ['85%', '90%'],
            content: url,
            success: function () {
                $(top.document.body).find('#layui-layer-iframe' + top.SearchTeacherLayerId).contents().find("td a").on('click', function () {
                    //alert($(this).attr('data-id'));
                    var order_id = $(this).attr('data-id');//订单编号
                    var url = "{:url('index/Quoted/addNexus')}";
                    var data = {'quoted_id':'{$quoteId}','orderinfo_id':order_id};
                    console.log(data);
                    $.post(url,data,function(info){
                        if (info){
                            layer.msg("写入成功",{icon:1,time:2000});
                            window.parent.location.reload();  //刷新父级页面
                        } else{
                            layer.msg("写入失败",{icon:5,time:2000});
                        }
                    },'json');
                    top.layer.close(top.SearchTeacherLayerId);
                    //location.replace(location.href);
                    //window.location.reload();  //刷新父级页面
                    //window.parent.location.reload();  //刷新父级页面
                });
            }
        });
    }

</script>

</html>